package com.Lyy.Dao;

import com.Lyy.Entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;

public interface StudentMapper {
    @Select("select * from demo.student")
    List<Student> SelectStudentAll();
    @Select("select * from demo.student where studentName like '%${studentName}%'")
    List<Student> SelectStudentName(String studentName);
    @Select("select * from demo.student where studentId = #{studentId}")
    Student SelectStudentById(int studentId);
    @Update("update demo.student set studentName =#{studentName},classname = #{classname},classTeacher = #{classTeacher} where studentId = #{studentId}")
    int UpdateStudent(Student student);
    @Delete("delete from demo.student where studentId = #{studentId}")
    int DeleteStudentById(int studentId);
    @Insert("insert into demo.student (studentName, classname, classTeacher) VALUES (#{studentName}, #{classname}, #{classTeacher})")
    int InsertStudent(Student student);
}
